<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
<style>
table,tr,td{
 border:1px solid pink;
}
</style>
</head>
<body>
${msg }

<form action="StudentServlet?reqName=selectAll" align="center" method="post">
	姓名：<input type="text" name="name" value="${name }"/>
	<button type="submit">查询</button>
	<a href="studentadd.jsp">新增</a>
</form>



<table align="center" >
	<thead>
	
	
		<tr style="background-color: #ADFF2F" align="center">
			<td>id</td>
			<td>学生姓名</td>
			<td>学生性别</td>
			<td>联系电话</td>
			<td>QQ</td>
			<td>家庭地址</td>
			<td>所在班级</td>
			<td>操作</td>
		</tr>
	</thead>
	<tbody>
		<c:choose>
			<c:when test="${empty  alist }">
				<tr aling="center">
				    <td colspan="8" align="center">没有数据</td>
				</tr>
			</c:when>
			<c:otherwise>
			<c:forEach items="${alist }" var="u">
			<tr align="center">
				<td>${u.stuId }</td> 
				<td>${u.stuName }</td>
				<td>${u.sex }</td>
				<td>${u.mtel }</td>
				<td>${u.qq }</td>
				<td>${u.address }</td>
				<td>${u.className }</td>
				<td>
				<a href="StudentServlet?reqName=userDetail&stu_id=${u.stuId}" type="button">详情</a>
				</td>
			</tr>
		</c:forEach>
			</c:otherwise>
		</c:choose>
	
	
	</tbody>
	</table>
</body>
</html>